#ifndef WORDUSAGEVARIANT_H
#define WORDUSAGEVARIANT_H

#include <QObject>
#include "serializable.h"
#include "oxford-word-usage-example.h"

namespace Oxford
{

class WordUsageVariant : public Core::Serializable
{
    Q_OBJECT

    Q_PROPERTY(QString wordUsage READ wordUsage)
    Q_PROPERTY(QString usageRule READ usageRule)
    Q_PROPERTY(QString synonym READ synonym)

    Q_PROPERTY(QList<WordUsageExample> examples READ examples)
private:
    QString _wordUsage;
    QString _usageRule;
    QString _synonym;

    QList<WordUsageExample> _examples;

friend class
    Parser;
public:
    QString wordUsage() const
    {
        return _wordUsage;
    }

    QString usageRule() const
    {
        return _usageRule;
    }

    QString synonym() const
    {
        return _synonym;
    }

    const QList<WordUsageExample>& examples() const
    {
        return _examples;
    }

    bool isValid() const;
    ObjectString toString() const;
    static WordUsageVariant fromString(QString data);
};

}

#endif // WORDUSAGEVARIANT_H
